#include "keyframe.h"
namespace markerAR
{
    
Keyframe::Keyframe()
{

}



TrackFrame::TrackFrame()
{

}

TrackFrame::~TrackFrame()
{

}


//Keyframe::Keyframe(const Keyframe&a)
//{
//  this->img = a.img.clone();
//  this->Hnk  = a.Hnk;
//  this->C = a.C;
//  this->feature = SingleScaleStructrue(a.feature);
//  this->m_smallBlurImage = a.m_smallBlurImage.clone();
//  this->mainMarkerID = a.mainMarkerID;
//}

//TODO: Add a function to set d_scaleOfsmallBlurImages
void Keyframe::setSmallBlurImage()
{
  if (img.empty()) {
    m_smallBlurImage = Mat();
      return;
  }
  cv::Size imgSize = img.size();
    CV_Assert(img.channels() == 1);
    cv::resize(img, m_smallBlurImage, Size(d_scaleOfsmallBlurImage*imgSize.width,d_scaleOfsmallBlurImage*imgSize.height));
  m_smallBlurImage.convertTo(m_smallBlurImage, CV_16S);
    auto m = mean(m_smallBlurImage);
    for (int i=0; i<m_smallBlurImage.rows; ++i) {
        auto p = m_smallBlurImage.ptr<short>(i);
        for (int j=0; j<m_smallBlurImage.cols; ++j) {
            p[j] -= m(0);
        }
    }
}


}